import org.junit.*;

/**
 * @author 10277
 */
public class NGuessNumberTest {
    private NGuessNumber nGuessNumber;
    @BeforeClass
    public static void setUpBeforeClass() throws Exception{
        System.out.println("@BeforeClass");
    }
    @AfterClass
    public static void tearDownAfterClass() throws Exception{
        System.out.println("@AfterClass");
    }
    @Before
    public void setUp() throws Exception {
        nGuessNumber=new NGuessNumber();
        System.out.println("测试开始");
    }

    @After
    public void tearDown() throws Exception {
        System.out.println("测试结束");
    }
    @Test
    public void generateAnswerTest() {
        Assert.assertEquals(4,NGuessNumber.generateAnswer().length);
    }
    @Test
    public void getPlayerInputTest() {
        Assert.assertEquals(4,NGuessNumber.getPlayerInput().length);
    }
    @Test
    public void compareGuessAnswerTest(){
        Assert.assertEquals(4,NGuessNumber.compareGuessAnswer(NGuessNumber.generateAnswer(),NGuessNumber.getPlayerInput()));
    }
    @Test
    public void isWinTest(){
        Assert.assertEquals(true,NGuessNumber.isWin(NGuessNumber.compareGuessAnswer(NGuessNumber.generateAnswer(),NGuessNumber.getPlayerInput())));
    }

}